import argparse


def get_args():
    parser = argparse.ArgumentParser("Reinforcement Learning experiments for multiagent environments")

    parser.add_argument("--run-num-pretrained", type=int, default=19,
                        help="set this to load a particular checkpoint num")
    parser.add_argument("--total-test-episodes", type=int, default=1, help="total num of testing episodes")
    # initialize environment hyperparameters

    parser.add_argument("--env-name", type=str, default='Soccer-offense')
    parser.add_argument("--max-ep-len", type=int, default=300)
    parser.add_argument("--max-training-timesteps", type=int, default=int(1e7))
    parser.add_argument("--save-model-freq", type=int, default=int(2e5))
    parser.add_argument("--switch-model-freq", type=int, default=int(1e7))

    parser.add_argument("--action-std", type=float, default=0.8,
                        help="starting std for action distribution (Multivariate Normal)")
    # parser.add_argument("--action-std-decay-rate", type=float, default=0.05,
    #                     help="linearly decay action_std (action_std = action_std - action_std_decay_rate)")
    parser.add_argument("--min-action-std", type=float, default=0.1)
    parser.add_argument("--action-std-decay-freq", type=int, default=int(2e5),
                        help="action_std decay frequency (in num timesteps)")

    ###################

    # PPO hyperparameters
    parser.add_argument("--K-epochs", type=int, default=80, help="update policy for K epochs in one PPO update")
    parser.add_argument("--eps-clip", type=float, default=0.2, help="clip parameter for PPO")
    parser.add_argument("--gamma", type=float, default=0.99)
    parser.add_argument("--lr-actor", type=float, default=0.0003)
    parser.add_argument("--lr-critic", type=float, default=0.001)
    parser.add_argument("--random-seed", type=int, default=1)

    ###################

    # env parameters
    a = 3
    b = 3
    parser.add_argument("--num1", type=int, default=a)
    parser.add_argument("--num2", type=int, default=b)
    parser.add_argument("--state-dim", type=int, default=2 * a + 2 * b + 4)
    parser.add_argument("--action-dim", type=int, default=2 * a)
    parser.add_argument("--field-length", type=int, default=20, help="length of the field")
    parser.add_argument("--field-width", type=int, default=30, help="width of the field")
    parser.add_argument("--radius-soccer", type=float, default=0.15, help="radius of the soccer")
    parser.add_argument("--radius-player", type=float, default=0.35, help="radius of the player")
    parser.add_argument("--gate-length", type=int, default=8, help="length of the gate")
    parser.add_argument("--time-step", type=float, default=0.1, help="time gap to change the state")
    parser.add_argument("--gamma-velocity", type=float, default=0.1, help="damping coef of velocity")
    parser.add_argument("--orient", type=bool, default=False, help="if the object has orientation")
    args = parser.parse_args()

    return args
